package ch.usi.inf.pf2.alu.nodes;

/**
 * This is an identifier node, it implements the Average function
 * 
 * @author Thomas Mantegazzi
 * 
 */

public class AverageNode extends IdentifierNode {

	public AverageNode(Node[] arguments) {
		super(arguments);
	}

	protected double compute(double[] args) {
		double sum = 0;
		for (double d : args) {
			sum += d;
		}
		return sum / args.length;
	}
}
